package config

import (
	"flag"
)

type AppParams struct {
	FirstPage string
	LogName   string
}

var CurAppParams *AppParams

func init() {
	CurAppParams = &AppParams{}
	firstPage := flag.String("r", "", "Routes to first page")
	flag.Parse()
	CurAppParams.FirstPage = *firstPage
	logName := flag.String("l", "fpga-vboard", "Log name")
	flag.Parse()
	if *logName != "fpga-vboard" {
		CurAppParams.LogName = *logName + ".log"
	} else if *firstPage != "" && *logName == "fpga-vboard" {
		CurAppParams.LogName = *firstPage + ".log"
	} else {
		CurAppParams.LogName = *logName + ".log"
	}
}
